{include file="public/header" /}
<body class="gray-bg">
<div class="wrapper wrapper-content">
    <div class="ibox float-e-margins">
        <div class="ibox-content">
            <div class="row">
                <!--搜索框开始-->
                <div class="col-sm-12">
                    <div class="layui-form layui-form-item">
                        <div class="layui-input-inline">
                            <a class="layui-btn" onclick="wk.href('{:url('index')}');">返回</a>
                        </div>
                        <div class="layui-col-md6 layui-input-inline">
                            <input type="text" id="key" class="layui-input search" name="key" value="" placeholder="订单号"/>
                        </div>
						 <div class="layui-input-inline layui-form">
                            <select name="type" lay-search="">
                                <option  value="">不限</option>
                                <option  value="1">现金</option>
                                <option  value="2">积分</option>
                                <option  value="3">刷脸</option>
                            </select>
                        </div>
                        <div class="layui-input-inline">
                            <button class="layui-btn" lay-submit="" lay-filter="LAY-search">立即搜索</button>
                            <button  class="layui-btn layui-btn-normal" id="empty"  lay-submit="" lay-filter="LAY-search">重置</button>
                        </div>
                    </div>
                </div>
                <!--搜索框结束-->
                <div class="col-sm-12">
                    <div class="input-group" >
                        <input type="text" disabled class="layui-input" id="tongji1" value="" style="border:1px solid red;color: red;width: 500px;" />
                    </div>
                </div>
            </div>
            <div class="hr-line-dashed"></div>

            <div class="example-wrap">
                <div class="example">
                    <table class="layui-hide" id="test" lay-filter="demo"></table>
                    <script type="text/html" id="typeTpl">
                        {{# if(d.record_type == 1){ }}
                        现金
                        {{# }else if(d.record_type == 2){ }}
                        积分
						{{# }else if(d.record_type == 3){ }}
                        刷脸
                        {{# } }}
                    </script>
                    <script type="text/html" id="payTpl">
                        {{# if(d.record_payment_type == 1){ }}
                        支付宝
                        {{# }else if(d.record_payment_type == 2){ }}
                        微信
                        {{# } }}
                    </script>
					<script type="text/html" id="payTpl2">
                        {{d.record_shop_balance - d.record_money}}
                    </script>
                </div>
            </div>
        </div>
    </div>
</div>
{include file="public/footer" /}
<script>
    //layui渲染数据表格
    layui.use('table', function () {
        var table = layui.table
            , form = layui.form;
        table.render({
            elem: '#test'
            , url: '{:url("shop/recordList")}'
            ,response: {
                statusCode: 220 //成功的状态码，默认：0
            }
            , page: true
            , size: 'lg' //sm小尺寸的表格 lg大尺寸
            , cellMinWidth: 150
            , limits: [5, 10, 15, 20, 25, 30]
            , limit: "{:config('pages')}"
            , loading: true
            , id: 'testReload'
            , cols: [[
                {type:'numbers', width: 80, title: '序号'}
                , {field: 'record_number', width: '', title: '收款订单号', align: 'center'}
                , {field: 'user_username', width: '', title: '付款人', align: 'center'}
                , {field: 'shop_name', width: '', title: '收款人', align: 'center'}
                , {field: 'record_type', width: '', title: '收款类型', align: 'center',templet:"#typeTpl"}
                , {field: 'record_payment_type', width: '', title: '付款方式', align: 'center',templet:"#payTpl"}
                , {field: 'record_jifen', width: '', title: '支付积分', align: 'center'}
                , {field: 'record_money', width: '', title: '支付现金', align: 'center'}
                , {field: 'record_shop_balance', width: '', title: '商家余额', align: 'center',templet:"#payTpl2"}
                , {field: 'shop_balance', width: '', title: '当前余额', align: 'center'}
                , {field: 'shop_integral', width: '', title: '当前积分', align: 'center'}
                , {field: 'shop_pledge_money', width: '', title: '当前押金', align: 'center'}
                , {field: 'record_give_jifen', width: '', title: '赠送积分', align: 'center'}
                , {field: 'record_remark', width: '', title: '备注', align: 'center'}
                , {field: 'record_pay_time', width: '', title: '支付时间', align: 'center'}
            ]],
            done:function (res, curr, count) {
                $('#tongji1').val('扫码收入：'+res.getget+' 元'+'，线上收入：'+res.getget2+' 元'+'，已提现：'+res.outout+' 元');
            }
        });
    });
</script>
</body>
</html>